#!/usr/bin/env bash
#
#

. ./base.sh

src_vod="/update/vod_v38_stable.tar.gz"
dest_vod="/home/vod_v38_stable.tar.gz"

function update_prog() {
    vod=`basename $dest_vod`
    program=`echo $vod |awk -F . '{print $1}'`
    printf_c "downloading... $vod"
#    agv_md5=`md5_process $src_vod`
    down_stat=`http_download $src_vod $dest_vod`
    if [[ "$down_stat" == 0 ]];then
        printf_c "download $vod fisish"
        printf_c "updating... java program"
        tar fx $dest_vod -C /home/ && cd /home/$program &&bash install.sh && printf_c "update java program finish" || printf_c "update java program failed" $err_c
    else
        printf_c "download $vod error" $err_c
        return 1
    fi
}

update_prog
